package etf.library;

import java.util.HashSet;
import java.util.Set;

public class Book {
	
	private String title;
	private int year;
	private Category category;
	private Author author;
	private Set<Member> renters = new HashSet<Member>();
	
	public Book(){}
	
	public Book(String bookTitle){
		this.title = bookTitle;
	}
	
	public Book(String bookTitle,int yearOfPublication,Category category,Author author){
		this.title = bookTitle;
		this.year = yearOfPublication;
		this.category = category;
		this.author = author;
	}

	public Category getCategory() {
		return category;
	}

	public void setCategory(Category category) {
		this.category = category;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String bookTitle) {
		this.title = bookTitle;
	}

	public int getYear() {
		return year;
	}

	public void setYear(int year) {
		this.year = year;
	}

	public Author getAuthor() {
		return author;
	}

	public void setAuthor(Author author) {
		this.author = author;
	}
	
	public void setRenters(Set<Member> renters) {
		this.renters = renters;
	}

	public Set<Member> getRenters() {
		return renters;
	}
	
	public void addRenter(Member member){
		this.renters.add(member);
	}
	
	public void removeARenter(Member member){
		this.renters.remove(member);
	}
	
	@Override
	public String toString() {
		return "Book [author=" + author + ", bookTitle=" + title
				+ ", category=" + category + "]";
	}


	
}
